import App from './App'
import { createSSRApp } from 'vue'

import * as Pinia from 'pinia';
import { createUnistorage } from 'pinia-plugin-unistorage'
import uviewPlus from 'uview-plus'

import config from '@/common/config.js'
import utils from '@/common/utils.js'
import common from '@/common/common.js'



export function createApp() {
	const app = createSSRApp(App)

	const store = Pinia.createPinia()
	store.use(createUnistorage())
	app.use(store)

	app.provide('config', config)
	app.provide('Utils', utils)
	app.provide('common', common)
	app.use(uviewPlus)

	return {
		app,
		Pinia
	}
}